package com.ssky.bean.validator.proxy;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class ValidatorClassLoader
        extends ClassLoader {
    private static final Logger L = LoggerFactory.getLogger(ValidatorClassLoader.class);
    private static final ValidatorClassLoader Loader = new ValidatorClassLoader();
    private ValidatorClassLoader(){}


    public static ClassLoader getCustomCLoader(Class clazz) {
        ClassLoader cLoader = clazz.getClassLoader();

        if ("sun.misc.Launcher$AppClassLoader".equals(cLoader.getClass().getName())) {
            cLoader = Loader;
        }
        return cLoader;
    }
}